        var overseaTaxListStore = new Ext.data.JsonStore({
			url: '/weihe/getSumList_overseaTax',
			root: 'datas',
			fields : [{
						name:'OverseaTaxId',mapping:'id'
					},{
     				    name:'OverseaTaxDate', mapping:'date',type : 'date', dateFormat:"Y-m-d"
      			  	},{
				    	name:'OverseaTaxTax1',mapping:'tax1'
				    },{
				    	name:'OverseaTaxTax2',mapping:'tax2'
				    },{
				    	name:'OverseaTaxTax3',mapping:'tax3'
				    },{
				    	name:'OverseaTaxSum',mapping:'sum'
				    }],
					listeners :{ 
					   'beforeload':function(s,options) {
							var tag = 0;
							Ext.Ajax.request({
								url : '/weihe/getListJudge_overseaTax',
								success : function(response) {
									var json = Ext.decode(response.responseText);
									if (json.deny) {
										Ext.Msg.alert('错误',json.msg);
										tag = 1;
									}
										if(tag == 1){
											return false;
										}else{
											return true;						
										}
								},
								failure : function() {
									Ext.Msg.alert('错误', '失败!');
									tag =1;
								}
							});
			   }
			}
		});
        
        
        

        var overseaTaxStore = new Ext.data.JsonStore({
			url: '/weihe/getList_overseaTax',
			root: 'datas',
			fields : [{
						name:'OverseaTaxId',mapping:'id'
					},{
     				   name:'OverseaTaxDate', mapping:'date',type : 'date', dateFormat:"Y-m-d H:i:s"
      			  	},{
				    	name:'OverseaTaxTax1',mapping:'tax1'
				    },{
				    	name:'OverseaTaxTax2',mapping:'tax2'
				    },{
				    	name:'OverseaTaxTax3',mapping:'tax3'
				    },{
				    	name:'OverseaTaxSum',mapping:'sum'
				    }],
					listeners :{ 
					   'beforeload':function(s,options) {
							var tag = 0;
							Ext.Ajax.request({
								url : '/weihe/getListJudge_overseaTax',
								success : function(response) {
									var json = Ext.decode(response.responseText);
									if (json.deny) {
										Ext.Msg.alert('错误',json.msg);
										tag = 1;
									}
										if(tag == 1){
											return false;
										}else{
											return true;						
										}
								},
								failure : function() {
									Ext.Msg.alert('错误', '失败!');
									tag =1;
								}
							});
			   }
			}
		});
        
    	
    	

overseaTaxs = function(){
  return{
     
	  overseaTaxListGrid : function(){

		var pageToolBar = new Ext.PagingToolbar({
			pageSize : 5,
			store : overseaTaxListStore,
			displayInfo : true,
			displayMsg : '当前显示{0}-{1}条记录,共{2}条记录',
		    emptyMsg : "没有记录显示!",
		    firstText : '首页',
		    prevText : '上一页',
		    nextText : '下一页',
		    lastText : '尾页',
		    beforePageText : '第',
		    afterPageText : '页,共{0}页'
		   
		});

	

		var rowSelectionModel = new Ext.grid.RowSelectionModel({singleSelect : true});
		
		 
	   var overseaTaxListGrid = new Ext.grid.GridPanel({
		   id:'overseaTaxListGrid',
		   title : '国外税表',
		   region : 'north',
		   height :300,
		   minColumnWidth : 50,
		   tbar:["-",'查看年份:',new Ext.form.TextField({id:'year',name:'query',value:(new Date()).format('Y'),width:'50'}),new Ext.Button({text:'提交',handler : function() {
			   					Ext.getCmp("overseaTaxListGrid").getStore().baseParams = {'query':Ext.getCmp('year').getValue()};
			   					Ext.getCmp("overseaTaxListGrid").getStore().load({params : {start : 0, limit : 5}});
			   					Ext.getCmp("overseaTaxGrid").getStore().removeAll();
		   		}})
		   ,"-"],

		   loadMask : {msg:'正在加载数据，请稍侯...'},
		   store : overseaTaxListStore,
		   columns: [
		             {header : '日期', dataIndex : 'OverseaTaxDate',renderer:function(value){
							if(value != null){
									return value.format('Y-m');
								}else{
									return '本年累计';
								}
		             }},
		             {header : '税1', dataIndex : 'OverseaTaxTax1'},
		             {header : '税2', dataIndex : 'OverseaTaxTax2'},
		             {header : '税3', dataIndex : 'OverseaTaxTax3'},
		             {header : '合计', dataIndex : 'OverseaTaxSum'}
        ],
           sm : rowSelectionModel,
           listeners :{ 
			   'rowclick':function(grid, rowIndex, event) {
			   var record = grid.getStore().getAt(rowIndex);
			  	if(record.get('OverseaTaxDate')!=null){
			  	 var d = record.get('OverseaTaxDate').format('Y-m')+"";
			  	 Ext.getCmp("overseaTaxGrid").getStore().baseParams = {'query':d};
			   	 Ext.getCmp("overseaTaxGrid").getStore().load({params : {start : 0, limit : 5}});
			   	}
		
			   }
		},
		  viewConfig : {
		     forceFit : false
		  },
		  bbar : pageToolBar
});
		return overseaTaxListGrid;
	},
  	 overseaTaxGrid : function(){

		var pageToolBar = new Ext.PagingToolbar({
			pageSize : 5,
			store : overseaTaxStore,
			displayInfo : true,
			displayMsg : '当前显示{0}-{1}条记录,共{2}条记录',
		    emptyMsg : "没有记录显示!",
		    firstText : '首页',
		    prevText : '上一页',
		    nextText : '下一页',
		    lastText : '尾页',
		    beforePageText : '第',
		    afterPageText : '页,共{0}页'
		   
		});

		var rowSelectionModel = new Ext.grid.RowSelectionModel({singleSelect : true});
		 
	   var overseaTaxGrid = new Ext.grid.GridPanel({
		   id:'overseaTaxGrid',
		   title : '国外税表',
		   region : 'center',
		   minColumnWidth : 50,
		   loadMask : {msg:'正在加载数据，请稍侯...'},
		   store : overseaTaxStore,
		   columns: [
		             {header : '日期', dataIndex : 'OverseaTaxDate',sortable : true,renderer:Ext.util.Format.dateRenderer('Y-m-d H:i:s'),width:130},
		             {header : '税1', dataIndex : 'OverseaTaxTax1'},
		             {header : '税2', dataIndex : 'OverseaTaxTax2'},
		             {header : '税3', dataIndex : 'OverseaTaxTax3'},
		             {header : '合计', dataIndex : 'OverseaTaxSum'}
        ],
           sm : rowSelectionModel,
           listeners :{ 
			   'rowclick':function(grid, rowIndex, event) {
			   var record = grid.getStore().getAt(rowIndex);
				   Ext.getCmp("overseaTaxForm").form.loadRecord(record);
				   Ext.getCmp("overseaTaxForm").buttons[0].setText('修改');
		   }
		},
		  viewConfig : {
		     forceFit : false
		  },
		  bbar : pageToolBar
});
		return overseaTaxGrid;
	},
	overseaTaxForm : function(){
		var button_add = new Ext.Button({
			text : '添加',
			handler : function() {
					progressConsole();
				if(overseaTaxForm.form.isValid()){ 	
					if (overseaTaxForm.form.findField("overseaTax.id").getValue() == "") {
						overseaTaxForm.form.submit({
						  url : '/weihe/add_overseaTax',
						   success : function(form, action) {
							  if (action.result.deny) {
									 Ext.Msg.alert('错误', action.result.msg);
							   }else{
								Ext.Msg.alert('消息', action.result.msg, function() {
			  							   var d = overseaTaxForm.form.findField("overseaTax.date").getValue().format('Y-m')+"";
			  	 						   Ext.getCmp("overseaTaxGrid").getStore().baseParams = {'query':d};
			   	 						   Ext.getCmp("overseaTaxGrid").getStore().load({params : {start : 0, limit : 5}});
									       Ext.getCmp("overseaTaxListGrid").getStore().reload();
									       overseaTaxForm.form.reset();
								});
							  }
						    }
					    });
					}else {
						overseaTaxForm.form.submit({
							  url : '/weihe/update_overseaTax',
							   success : function(form, action) {
								 if (action.result.deny) {
									 Ext.Msg.alert('错误', action.result.msg);
							   }else{
									Ext.Msg.alert('消息', action.result.msg, function() {
										overseaTaxForm.form.reset();
										Ext.getCmp("overseaTaxGrid").getStore().reload();
										Ext.getCmp("overseaTaxListGrid").getStore().reload();
										overseaTaxForm.buttons[0].setText('添加');
										
									});
								  }
							    }
						    });
					}
			}else{
				Ext.Msg.alert('提示','请输入相关内容');
			}
				}
		
			
		});

	var button_clear = new Ext.Button({
		id : 'button_clear',
		text : '清空',
		handler : function() {
			overseaTaxForm.form.reset();
			overseaTaxForm.buttons[0].setText('添加');
		}
	});

	var button_del = new Ext.Button({
		text : '删除',
		handler : function() {
			var id = overseaTaxForm.form.findField('overseaTax.id').getValue();
			if (id == '') {
				Ext.Msg.alert('提示', '请选择需要删除的信息!');
			} else {
				progressConsole();
				Ext.Ajax.request({
					url : '/weihe/delete_overseaTax',
					success : function(response) {
						var json = Ext.decode(response.responseText);
						if (json.success) {
							if (json.deny) {
								Ext.Msg.alert('消息', json.msg);
								overseaTaxForm.form.reset();
								overseaTaxForm.buttons[0].setText('添加');
							}else{
								Ext.Msg.alert('消息', json.msg, function() {
									Ext.getCmp("overseaTaxGrid").getStore().reload();
									Ext.getCmp("overseaTaxListGrid").getStore().reload();
									overseaTaxForm.form.reset();
									overseaTaxForm.buttons[0].setText('添加');
							});
						  }
						}else{
							Ext.Msg.alert('消息', json.msg);
						}
					},
					failure : function() {
						Ext.Msg.alert('错误', '删除失败!');
					},
					params : 'overseaTax.id=' + id
				});
			}
		}
	});
	

	var  overseaTaxForm = new Ext.form.FormPanel({
		id : 'overseaTaxForm',
		title : '国外税费信息',
		frame : true,
		width : 300,
		region : 'east',
		autoScroll : true,
		collapseMode :'mini',
		collapsible : true,
		labelAlign : 'right',
		labelWidth : 75,
		defaultType : 'textfield',
			defaults : {
			width : 200
		},
		items : [{  
			id:'OverseaTaxId',
			xtype : 'hidden',  
			name : 'overseaTax.id'
		},{
			id:'OverseaTaxDate',
			xtype: 'datetimefield',
			fieldLabel: '日期',
			name: 'overseaTax.date',
			value: (new Date()).format('Y-m-d H:i:s'),
			format: 'Y-m-d H:i:s'						
		},{
			id:'OverseaTaxTax1',
			fieldLabel : '税1',
			name : 'overseaTax.tax1',
			regex : /^$|^\d+(\.\d+)?$/,
		    regexText:'请输入有效的价格' 
		},{
			id:'OverseaTaxTax2',
			fieldLabel : '税2',
			name : 'overseaTax.tax2',
			regex : /^$|^\d+(\.\d+)?$/,
		    regexText:'请输入有效的价格' 
		},{
			id:'OverseaTaxTax3',
			fieldLabel : '税3',
			name : 'overseaTax.tax3',
			regex : /^$|^\d+(\.\d+)?$/,
		    regexText:'请输入有效的价格' 
		}],
		buttons : [button_add,button_clear,button_del]
	});
		return  overseaTaxForm;
	}
  }
}();








